﻿using System.IO;
using AutoMapper;
using NetCore.Entities.Needs;
using NetCore.Extensions;
using NetCore.Needs.Dtos;

namespace NetCore.Needs
{
    /// <summary>
    /// 客户需求实体-dto映射
    /// </summary>
    public class NeedDtoMapper : Profile
    {
        public NeedDtoMapper()
        {
            CreateMap<Need, NeedDto>();
            CreateMap<NeedAttachment, NeedAttachmentDto>();
                //.ForMember(n => n.FilePath, //暂时获取上传文件名
                //    source => source.MapFrom(o => o.FilePath.HasValue()? Path.GetFileName(o.FilePath) : string.Empty));
        }
    }
}
